package criterios;

import domain.Paquete;
import domain.Puerto;

public class PorRangoPuerto extends Criterio {

	private Puerto puertoInicial;
	private Puerto puertoFinal;
	
	public PorRangoPuerto(Puerto puertoInicial, Puerto puertoFinal) {
		super();
		this.puertoInicial = puertoInicial;
		this.puertoFinal = puertoFinal;
	}
	
	@Override
	public boolean aplicarCriterio(Paquete paquete) {
		return paquete.getPuertoDestino().estaEnRango(getPuertoInicial(), getPuertoFinal());
	}
	
	public Puerto getPuertoInicial() {
		return puertoInicial;
	}
	public void setPuertoInicial(Puerto puertoInicial) {
		this.puertoInicial = puertoInicial;
	}
	public Puerto getPuertoFinal() {
		return puertoFinal;
	}
	public void setPuertoFinal(Puerto puertoFinal) {
		this.puertoFinal = puertoFinal;
	}
}
